﻿using UnityEngine;

namespace Game
{
    public class ScenePlayerTrackObjectMoveTransition : SceneObjectStateTransition
    {
        public ScenePlayerTrackObjectMoveTransition(int fromState, int toState, int priority) : base(fromState, toState, priority)
        {
        }

        public override bool CanTransfer(SceneObjectBTContext context)
        {
            ScenePlayerBTContext playerBtContext = (ScenePlayerBTContext) context;
            SceneObjectEntity trackObject = playerBtContext.trackObject;
            return Vector3.Distance(trackObject.position, context.sceneObject.position) > SceneConst.PlayerTrackDistance;
        }
    }
}